package com.itheima.web.mapper.pms;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.vo.pms.PmsProductCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductCategoryMapper extends BaseMapper<PmsProductCategory> {
    @Select("select * from pms_product_category where parent_id=#{i}")
    List<PmsProductCategory> selectByParentId(int i);

    List<PmsProductCategory> selectByparentId(@Param("parentId") int parentId, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    long countByParentId(Integer parentId);

    void updateByIds(@Param("ids") List<Integer> ids,@Param("navStatus") Integer navStatus);

    void updateByIds2(@Param("ids") List<Integer> ids,@Param("showStatus") Integer showStatus);

    @Select("select * from pms_product_category where name=#{name}")
    PmsProductCategory getByName(String name);
}
